<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>发布新帖子</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .post-form {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
        }
    </style>
</head>
<body>
<div class="container mt-5">
    <h2 class="text-center mb-4">发布新帖子</h2>
    <div class="post-form">
        <form th:action="@{/user/post/add}" method="post">
            <div class="form-group">
                <label for="title">标题</label>
                <input type="text" class="form-control" id="title" name="title" required>
            </div>
            <div class="form-group">
                <label for="context">内容</label>
                <textarea class="form-control" id="context" name="context" rows="5" required></textarea>
            </div>
            <button type="submit" class="btn btn-primary mt-3">发布</button>
        </form>
    </div>
    <!-- 返回按钮 -->
    <div class="mt-4 text-center">
        <a th:href="@{/user/index}" class="btn btn-secondary">返回首页</a>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>